MenuTreePanel = Ext.extend(Ext.tree.TreePanel,{ 
    						border :false,
    						scrollY : true,
    						autoHeight: true,
    						rootVisible:false,
    						initComponent : function() {
								var url,rootId ;
								url = this.url||'user_getMainPage.action';
								this.loader =  new Ext.tree.TreeLoader({
	    							url : url,
	    							root:'root'
    							})
								rootId = this.rootId;
								this.root =  new Ext.tree.AsyncTreeNode({
	    						  id:rootId,
	    						  text:'�˵�', 
	    						  draggable:false,
	    						  expended:true
	    						});
								 MenuTreePanel.superclass.initComponent.call(this);
    						},
    						listeners : {
    							'click': function(n) {
    								var main = Ext.getCmp('main-panel');
    								var cid = "panel-"+n.id;
    								var name = n.attributes.objectName ;
    								var jsSource = n.attributes.jsSource ;
    								var debug = n.attributes.debug ;
    								var afterLoader = n.attributes.afterLoader ;
    								var b = main.getComponent(cid);
    								if(b) {
    									main.setActiveTab(b);
    								}else {
    									if(n&&n.isLeaf()) {
	    									if(jsSource && jsSource!=null) {
//	    										Ext.Ajax.request(    
//											     {    
//											       method: 'POST',    
//											       disableCaching :false,    
//											       url: jsSource,    
//											       success: function(response) {    
//											           var module = eval(response.responseText);  
//			    										eval('var a = new '+name);
//			    										a.title = n.text;
//			    										a.id = cid; 
//			    										a.treeNode = n;
//	    												main.add(a);
//	    												main.setActiveTab(a);
//	    												if(afterLoader && afterLoader!=null) {
//	    													eval(afterLoader+"(a)") ;
//	    												}
//											       }    
//											     }    
//											    ); 
	    										if(n.isLoader && n.isLoader) {
	    											eval('var a = new '+name);
			    										a.title = n.text;
			    										a.id = cid; 
			    										a.treeNode = n;
	    												main.add(a);
	    												main.setActiveTab(a);
	    												if(afterLoader && afterLoader!=null) {
	    													eval(afterLoader+"(a)") ;
	    												}
	    										} else { 
		    										Ext.Loader.load([jsSource],function(){
		    											n.isLoader = true ;
		    											eval('var a = new '+name);
				    										a.title = n.text;
				    										a.id = cid; 
				    										a.treeNode = n;
		    												main.add(a);
		    												main.setActiveTab(a);
		    												if(afterLoader && afterLoader!=null) {
		    													eval(afterLoader+"(a)") ;
		    												}
		    										});
	    										}
    										} else {
    												eval('var a = new '+name);
		    										a.title = n.text;
		    										a.id = cid; 
		    										a.treeNode = n;
    												main.add(a);
    												main.setActiveTab(a);
    												if(afterLoader && afterLoader!=null) {
	    													eval(afterLoader+"(a)") ;
	    											}
    										}

	    									}
    								}
    								
    							},
								'expandnode':function(node) {
									if(node && node.firstChild && node.firstChild.isLeaf() &&node.firstChild.attributes.expanded) {
										node.firstChild.fireEvent('click',node.firstChild);
									}
								}
    						}
    					})
